package com.aos.erp.schools.service.student.imp;

import com.aos.erp.schools.mapper.student.StudentWarningMapper;
import com.aos.erp.schools.model.student.StudentWarning;
import com.aos.erp.schools.service.student.StudentWarningService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: chb
 * @Date: 2018/11/1 19:03
 * @Description:  学员预警信息
 */
@Service
public class StudentWarningServiceImpl extends ServiceImpl<StudentWarningMapper,StudentWarning> implements StudentWarningService {

    @Resource
    private StudentWarningMapper studentWarningMapper;
    @Override
    public void addBean(StudentWarning studentWarning) throws Exception {
            this.save(studentWarning);
    }

    @Override
    public int update(StudentWarning studentWarning) {
     return   studentWarningMapper.update(studentWarning);
    }

    @Override
    public List<StudentWarning> getStudentById(Long studentId) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("student_id",studentId);
        return this.list(queryWrapper);
    }
}
